package com.mxpio.erp.common.util;

import com.alibaba.excel.EasyExcel;
import com.mxpio.erp.common.EasyexcelCommonListener;

import java.io.InputStream;
import java.util.List;

public class ExcelUtil {

    public static <T> List<T> parseExcels(InputStream inputStream, Class<T> tClass) {

        EasyexcelCommonListener<T> excelListener = new EasyexcelCommonListener<>();
        EasyExcel.read(inputStream,tClass,excelListener).sheet().doRead();
        List<T> importModels = excelListener.getList();
        return importModels;
    }
}
